﻿using QFramework;
using UnityEngine;

namespace ProjectMyFarmAndShe
{
    public class ShowerTool : ITool
    {
        public string Name => "花洒工具";
        public string Key => "ShowerTool";
        public ToolType Type => ToolType.Tool;
        public float UseBrawn => 2.5f;

        /// <summary>
        /// 浇水
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="grids"></param>
        public void Use(Vector3Int pos, DynaGrid<GridData> grids)
        {
            var gridData = grids[pos.x, pos.y];
            if (gridData == null) return;
            
            Global.Brawn.Value -= UseBrawn;
            AudioKit.PlaySound("resources://Shower");
            gridData.SetWater(true);
        }
    }
}